<?php
include APPPATH . "views/frontend/inc/01_meta.php";
include APPPATH . "views/frontend/inc/02_head.php";
?>

<?php
if(!empty($cate->Thumb)){
	?>
	<div class="banner">
		<img style="position: absolute;width: 100%;height: 100%" src="<?php echo $cate->Thumb ?>"/>
	</div>
<?php
}else{
?>
<div class="banner-product"></div>
<?php
}
?>

<div class="navi">
    <a href="/home">Home</a>
    <span>/</span>
    <a href="/category/<?php echo $cate_type['key'] ?>"><?php echo $cate_type['name'] ?></a>
    <span>/</span>
    <a href="/category/<?php echo $cate_type['key'] ?>/<?php echo $group_cate->Id ?>-<?php echo $group_cate->Alias ?>"><?php echo $group_cate->Title ?></a>
    <span>/</span>
    <span class="active"><?php echo $cate->Title ?></span>
    <div class="clear"></div>
</div>
<script type="text/javascript">
    var cookie_name = 'cat_<?php echo $cate->Id ?>';
    frontend_config.filter_cate = <?php echo json_encode($filter_cate) ?>;
    frontend_config.category_type = "<?php echo $cate_type['key'] ?>";
    $(document).ready(function() {
        product_list_init();
    });
</script>
<div>
    <div class="menu-left">
        <div class="panel-group accordion" id="accordion-category">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <?php echo $cate->Title ?>
                        <span data-toggle="collapse" data-parent="#accordion-category" href="#collapseOne"
                              class="ico-collapse pull-right"></span>
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <ul id="search-menu-control-category">
                            <?php
                            if (!empty($cate->Children)) {
                                foreach ($cate->Children as $c) {
                                    ?>
                                    <li class="item control_checkbox_item"  data-cookie_name="category">
                                        <div>
                                            <span class="icheckbox" data-item_id="<?php echo $c->Id ?>"></span>
                                            <span><?php echo $c->Title ?></span>
											<span class="pull-right">(<?php echo $c->Total ?>)</span>
                                        </div>
                                    </li>
                                    <?php
                                }
                            } else {
                                ?>
                                <li>No data to display</li>
                                <?php
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="panel-group accordion" id="accordion-size">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        SIZE
                        <span data-toggle="collapse" data-parent="#accordion-size" href="#collapseOneSize"
                              class="ico-collapse pull-right"></span>
                    </h4>
                </div>
                <div id="collapseOneSize" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <ul id="search-menu-control-size">
                            <?php
                            if (!empty($sizes)) {
                                foreach ($sizes as $size) {
                                    ?>
                                    <li class="item control_checkbox_item"  data-cookie_name="size">
                                        <div>
                                            <span class="icheckbox" data-item_id="<?php echo $size->size_id ?>"></span>
                                            <span><?php echo $size->size_name ?></span>
											<span class="pull-right">(<?php echo $size->size_total ?>)</span>
                                        </div>
                                    </li>
                                    <?php
                                }
                            } else {
                                ?>
                                <li>No data to display</li>
                                <?php
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel-group accordion" id="accordion-color">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        COLOR
                        <span data-toggle="collapse" data-parent="#accordion-size" href="#collapseOneColor"
                              class="ico-collapse pull-right"></span>
                    </h4>
                </div>
                <div id="collapseOneColor" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <ul id="search-menu-control-color">
                            <?php
                            if (!empty($colors)) {
                                foreach ($colors as $color) {
                                    ?>
                                    <li class="item control_checkbox_item"  data-cookie_name="color">
                                        <div style="">
                                            <span class="icheckbox" data-item_id="<?php echo $color->color_id ?>"></span>
                                            <span><?php echo $color->color_name ?></span>
											<span class="pull-right">(<?php echo $color->color_total ?>)</span>
                                        </div>
                                    </li>
                                    <?php
                                }
                            } else {
                                ?>
                                <li>No data to display</li>
                                <?php
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        
    </div>
    <div class="main-content">
        <div>
            <?php include APPPATH . "views/frontend/product/03_product_list.php";?>
        </div>
    </div>
</div>
<div class="clear"></div>
<?php
include APPPATH."views/frontend/inc/03_foot.php";
?>